﻿using FreeSql.DataAnnotations;

using Tszy.Unlimited.Base.Infrastructure.Domain;

namespace Project2.Domain
{
    /// <summary>
    /// 领域根基类。
    /// </summary>
    public abstract class AggregateRootBase : AggregateRoot<long>
    {
        protected AggregateRootBase() { }
        protected AggregateRootBase(long identity, DateTime created) : base(identity, created) { }

        [Column(IsIdentity = true, IsPrimary = true, Name = "Id")]
        public override long Identity { get => base.Identity; protected set => base.Identity = value; }

        public override DateTime Created { get => base.Created; protected set => base.Created = value; }

        [Column(IsIgnore = true)]
        public override IReadOnlyCollection<IDomainEvent> DomainEvents => base.DomainEvents;
    }
}